package com.apimanage.auth.utils;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

/**
 * 简单的密码检查工具类
 */
public class PasswordChecker {
    
    public static void main(String[] args) {
        // 数据库中存储的加密密码
        String encryptedPassword = "$2a$10$e1g5j6k7l8m9n0o1p2q3r4s5t6u7v8w9x0y1z2a3b4c5d6e7f8g9h0";
        
        // 常见的默认密码列表
        String[] commonPasswords = {
            "admin", 
            "123456", 
            "admin123", 
            "password", 
            "12345678",
            "123456789",
            "root",
            "1234",
            "temp_password",
            "user123456",
        };
        
        BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
        
        System.out.println("Checking common default passwords...");
        
        for (String password : commonPasswords) {
            boolean matches = encoder.matches(password, encryptedPassword);
            if (matches) {
                System.out.println("Found matching password: " + password);
                break;
            }
        }
    }
}